package PTA_JAVA.JavaA.Javademo16;

import java.util.Arrays;
import java.util.Scanner;

//这里编写泛型类WeekDay的定义
enum WeekDay{
    SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY;
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //这里包含一些用于统计的初始化代码
        int a=0,b=0;
        try {
            while(sc.hasNext()) {
                String weekDayStr = sc.next();
                //这里编写将weekDayStr转化为WeekDay类型变量x的代码
                WeekDay x = WeekDay.valueOf(weekDayStr);
                //这里编写使用switch根据x类型输出对应信息并统计的代码
                switch(x){
                    case SUNDAY:
                        System.out.println(x+"是休息日, 序号为0");
                        b++;
                        break;
                    case MONDAY:
                        System.out.println(x+"是工作日, 序号为1");
                        a++;
                        break;
                    case TUESDAY:
                        System.out.println(x+"是工作日, 序号为3");
                        a++;
                        break;
                    case WEDNESDAY:
                        System.out.println(x+"是工作日, 序号为2");
                        a++;
                        break;
                    case THURSDAY:
                        System.out.println(x+"是工作日, 序号为5");
                        a++;
                        break;
                    case FRIDAY:
                        System.out.println(x+"是工作日, 序号为4");
                        a++;
                        break;
                    case SATURDAY:
                        System.out.println(x+"是休息日, 序号为6");
                        b++;
                        break;
                    default:
                        System.out.println("输入错误");
                }
            }
        } catch (Exception e) {
            System.out.println("输入错误");
        }
        //这里输出统计信息
        System.out.println("工作日共"+a+"天");
        System.out.println("休息日共"+b+"天");
        //这里编写获得WeekDay常量数组并将其转化为String数组e的代码
        String[] e = {"SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"};
        //这里编写将e数组排序并打印出来的代码
        Arrays.sort(e);
        System.out.println(Arrays.toString(e));
        sc.close();
}
}

